package com.springboot.astra.service.serviceImpl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.springboot.astra.bean.Theme;
import com.springboot.astra.mapper.ThemeMapper;
import com.springboot.astra.service.ThemeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ThemeServiceImpl implements ThemeService {
    @Autowired
    ThemeMapper themeMapper;
    @Override
    public Theme getOneByThemeId(Integer id) {
        return themeMapper.getOneByThemeId(id);
    }

    @Override
    public List<Theme> getAll() {
        return themeMapper.getAll();
    }

    @Override
    public void insertOneTheme(Theme theme) {
        themeMapper.insertOneTheme(theme);
    }

    @Override
    public void updateOneById(Theme theme) {
        themeMapper.updateOneById(theme);
    }

    @Override
    public void deleteOneById(Theme theme) {
        themeMapper.deleteOneById(theme);
    }

    @Override
    public IPage<Theme> selectPageVo(Page<Theme> page, String query) {
        return themeMapper.selectPageVo(page,query);
    }
}
